cd /var/www/html/m2
find var vendor pub/static pub/media app/etc -type f -exec chmod g+w {} \;
find var vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} \;
chmod u+x bin/magento
cd /var/www/html
sudo chown -R apache:`egrep -i '^group' /etc/httpd/conf/httpd.conf|awk '{print $2}'` m2
service httpd restart
